import java.sql.SQLException;

import org.pojo.User;
import org.server.util.Mdd;

import junit.framework.TestCase;
import org.server.util.Mdd;
import org.server.dao.*;
/*
 * 
 * 
 * 对用户输入的密码进行md5的处理，如果得到的结果一样，说明用户的密码输入正确。这个过程根本不用解密。
 */
public class TESTMD5 extends TestCase {

	public void test()
	{
//		String instr = "hello world";
//		String mdstr = Mdd.MD5(instr);
//		System.out.println(mdstr);
//		System.out.println("md5码长度"+mdstr.length());
/*		
		UserDao userdao = new UserDao();
		User u = new User("123345","nihoame",Mdd.MD5("nihao"));
		try {
			userdao.saveUser(u);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
*/
		System.out.println(Mdd.MD5("nihao"));
		UserDao userdao = new UserDao();
		try {
			User newuser = userdao.loadUserByUsername("123345");
			System.out.println(newuser.getPassword());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
}
